﻿<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Image Processing API</title>
  <link rel="stylesheet" href="https://stackedit.io/style.css" />
</head>

<body class="stackedit">
  <div class="stackedit__html"><p></p><div class="toc"><h3>Catalogue </h3><ul><li><a href="#Image_Processing_API_1">Image Processing API</a></li><ul><li><a href="#1_Project_Brief_4">1. Project Brief</a></li><li><a href="#2_Requirement_16">2. Requirement</a></li><li><a href="#3_Using__Instance_28">3. Using  Instance</a></li><li><a href="#4_IO_format_41">4. I/O format</a></li><li><a href="#5_Test_Effectiveness_50">5. Test Effectiveness</a></li><li><a href="#6_Code_Download_99">6. Code Download</a></li></ul></ul></div><p></p>
<h1><a id="Image_Processing_API_1"></a>Image Processing API</h1>
<hr color="#000000" size="1&quot;">
<h2><a id="1_Project_Brief_4"></a>1. Project Brief</h2>
<p><em><strong>First, backlight removal</strong></em><br>
Backlight is a common problem in shooting. The backlight removal technology can effectively enhance the image quality taken under backlight and significantly improve the accuracy of face recognition under backlight.<br>
<em><strong>Second, low illumination enhancement</strong></em><br>
At night, insufficient illumination will lead to very poor image quality. Low illumination enhancement technology can effectively enhance the brightness of the image and restore the details of the image, which is of great help for video surveillance and license plate recognition at night.<br>
<em><strong>Third,Deblur</strong></em><br>
Image blurring processing chooses to highlight or suppress some features in the image. By improving brightness, white balance, noise removal, blur removal, fog removal and other functions, the image matches the visual response characteristics, enhances the subjective effect, and makes the picture clearer and easier to watch.Blurring phenomenon often appears in the imaging of moving objects, especially objects in high speed motion. Deblurring technology can effectively enhance the clarity of blurred images, and it can play a very good auxiliary role for face recognition in motion and license plate recognition on the highway.<br>
<em><strong>Fourth, Haze removal</strong></em><br>
The imaging of many images will be affected by the weather, especially the haze weather has a particularly significant impact on the surveillance video.Image defogging technology can effectively restore the image and video in haze state and improve the quality of surveillance video.</p>
<hr color="#000000" size="1&quot;">
<h2><a id="2_Requirement_16"></a>2. Requirement</h2>
<p><code>pip install -r requirements.txt</code></p>
<pre><code class="prism language-bash">torch
numpy
opencv-python
tqdm
fire
</code></pre>
<hr color="#000000" size="1&quot;">
<h2><a id="3_Using__Instance_28"></a>3. Using  Instance</h2>
<pre><code class="prism language-go"><span class="token keyword">import</span> processing as pro
<span class="token string">""</span><span class="token string">"Expected image(np.uint8) input within the range of [0..255]"</span><span class="token string">""</span>
pro<span class="token punctuation">.</span><span class="token function">back_lighting_compensation</span><span class="token punctuation">(</span>image<span class="token punctuation">,</span> level<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">)</span>
pro<span class="token punctuation">.</span><span class="token function">low_illumination_enhancement</span><span class="token punctuation">(</span>iamge<span class="token punctuation">,</span> level<span class="token operator">=</span><span class="token number">5</span><span class="token punctuation">)</span>
pro<span class="token punctuation">.</span><span class="token function">remove_indistinct</span><span class="token punctuation">(</span>image<span class="token punctuation">,</span> level<span class="token operator">=</span><span class="token number">7</span><span class="token punctuation">)</span>
pro<span class="token punctuation">.</span><span class="token function">remove_haze</span><span class="token punctuation">(</span>image<span class="token punctuation">)</span>
</code></pre>
<hr color="#000000" size="1&quot;">
<h2><a id="4_IO_format_41"></a>4. I/O format</h2>

<table>
<thead>
<tr>
<th>Function</th>
<th>Input Format</th>
<th>Output Format</th>
</tr>
</thead>
<tbody>
<tr>
<td>Back Lighting Compensation</td>
<td>RGB  [np.uint8]  in  [0…255]</td>
<td>float32 in [0…1]</td>
</tr>
<tr>
<td>Low Illumination Enhancement</td>
<td>RGB  [np.uint8]  in  [0…255]</td>
<td>float32 in [0…1]</td>
</tr>
<tr>
<td>Remove Indistinct</td>
<td>RGB  [np.uint8]  in  [0…255]</td>
<td>float32 in [0…1]</td>
</tr>
<tr>
<td>Remove Haze</td>
<td>RGB  [np.uint8]  in  [0…255]</td>
<td><font face="黑体" color="DeepSkyBlue">float64</font> in [0…1]</td>
</tr>
</tbody>
</table><h2><a id="5_Test_Effectiveness_50"></a>5. Test Effectiveness</h2>
<p><code>python processing.py 'image'</code></p>
<table>
    <tbody><tr>
        <td><center>
        <img src="https://img-blog.csdnimg.cn/20210628113319230.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3gwMDc2NjQ=,size_16,color_FFFFFF,t_70">
        </center>
        <center>
        Figure 1   Back Lighting Compensation
        </center></td> 
    </tr><tr>
</tr></tbody></table>
<table>
    <tbody><tr>
        <td><center>
        <img src="https://img-blog.csdnimg.cn/20210628113429792.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3gwMDc2NjQ=,size_16,color_FFFFFF,t_70">
        </center>
        <center>
        Figure 2   Low Illumination Enhancement
        </center></td> 
    </tr><tr>
</tr></tbody></table>
<table>
    <tbody><tr>
        <td><center>
        <img src="https://img-blog.csdnimg.cn/20210628115154713.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3gwMDc2NjQ=,size_16,color_FFFFFF,t_70">
        </center>
        <center>
        Figure 3   Remove Indistinct
        </center></td> 
    </tr><tr>
</tr></tbody></table>
<table>
    <tbody><tr>
        <td><center>
        <img src="https://img-blog.csdnimg.cn/20210628113528635.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3gwMDc2NjQ=,size_16,color_FFFFFF,t_70">
        </center>
        <center>
        Figure 4   Remove Haze
        </center></td> 
    </tr><tr>
</tr></tbody></table>
<h2><a id="6_Code_Download_99"></a>6. Code Download</h2>
<p>Link: <a href="https://blog.csdn.net/x007664/article/details/118299406">Visible only to fans</a>.</p>
</div>
</body>

</html>
